#include "heart.h"
#include <QPainter>

Heart::Heart()
{
    heart = false;
    pict.load(":/pictures/arts/heartfalse.png");
}

void Heart::paint(QPainter *painter, const QRect &rect) const
{
    painter->save();
    painter->setRenderHint(QPainter::Antialiasing, true);
    painter->setPen(Qt::NoPen);
    QRectF source(0.0, 0.0, 30.0, 30.0);
    painter->drawImage(rect, pict, source);
    painter->restore();
}

QSize Heart::sizeHint() const
{
    return pict.size();
}

void Heart::setHeart(const bool heart)
{
    if(heart)
        pict.load(":/pictures/arts/hearttrue.png");
    else
        pict.load(":/pictures/arts/hearttalse.png");

    this->heart = heart;
}
